import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)



export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import('@/view/home'),
      children:[
        {
          path: 'home',
          name: 'home',
          component: () => import('@/view/home'),
          meta: {
            requireAuth: true,             // 添加该字段，表示进入这个路由是需要登录的
          },
        },
        {
          path: 'top',
          name: 'top',
          component: () => import('@/view/tool/top'),
          meta: {
            requireAuth: true,             // 添加该字段，表示进入这个路由是需要登录的
          },
        },
        
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/view/login/index'),
    },
    
  ]
})
